package com.efast.cafe.portal.service.base.impl;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController;

import com.efast.cafe.framework.pager.Pagination;
import com.efast.cafe.framework.redis.ObjectRedisTemplate;
import com.efast.cafe.framework.service.CafeServiceImpl;
import com.efast.cafe.framework.util.SpringWebUtils;
import com.efast.cafe.portal.bean.base.PortalParameterQueryBean;
import com.efast.cafe.portal.bean.common.PortalUserSecurityBean;
import com.efast.cafe.portal.dao.base.PortalBaseParameterDao;
import com.efast.cafe.portal.entity.base.PortalBaseParameter;
import com.efast.cafe.portal.remote.base.PortalBaseParameterService;
import com.efast.cafe.portal.service.base.IPortalBaseParameterService;
import com.efast.cafe.portal.service.common.IParameterService;
import com.efast.cafe.util.StringUtil;
import com.efast.cafe.framework.constant.CommonConstant;
import com.efast.cafe.framework.exception.ServiceException;
import com.efast.cafe.framework.jdbc.JdbcDao;
import com.efast.cafe.framework.jdbc.JdbcDaoImpl;
import com.efast.cafe.framework.jdbc.persistence.Criteria;
/**
 * ****************************************************************************
 * @File name   :      BaseParameterServiceImpl.java
 *
 * @Author      :      qubibo
 *
 * @Date        :      2016-6-7
 *
 * @Copyright Notice: 
 * Copyright (c) 2016 Efast Serv. All  Rights Reserved.
 * This software is published under the terms of the Efast Software
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 * 
 * 
 * ----------------------------------------------------------------------------
 * Date                   Who         Version        Comments
 * 2016-6-7 上午10:54:19        qubibo     1.0            Initial Version
 ****************************************************************************
 */
@Service/*("parameterService")*/
@Transactional
public class PortalBaseParameterServiceImpl  implements IPortalBaseParameterService{

	private ObjectRedisTemplate objectRedisTemplate;
	
	@Autowired
	public void setObjectRedisTemplate(ObjectRedisTemplate objectRedisTemplate) {
		this.objectRedisTemplate = objectRedisTemplate;
	}
	@Autowired
	private IParameterService parameterService;
	
	

	private PortalBaseParameterDao portalBaseParameterDao;
	
	
	@Qualifier("jdbcDao")
	@Autowired
	private JdbcDao JdbcDao;
	
	

	@Autowired
	public void setPortalBaseParameterDao(PortalBaseParameterDao portalBaseParameterDao) {
		this.portalBaseParameterDao = portalBaseParameterDao;
	}

	@Override
	public Pagination<PortalBaseParameter> queryListBaseParameter(
			Pagination<PortalBaseParameter> pager, PortalParameterQueryBean portalBaseParameter) {
		Criteria criteria = Criteria.create(PortalBaseParameter.class)
				.where(PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.GLOBAL});
		if(StringUtils.isNotBlank(portalBaseParameter.getParam_scope())){
			criteria.and(PortalBaseParameter.paramScope, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+portalBaseParameter.getParam_scope()+"%"});
		}
		if (StringUtils.isNotBlank(portalBaseParameter.getParam_key())) {
			criteria.and(PortalBaseParameter.paramKey, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+portalBaseParameter.getParam_key()+"%"});
		}
		pager.setSort("asc");
		pager.setOrderBy("portal_base_parameter_id");
		if(StringUtils.isNotBlank(pager.getOrderBy()) && StringUtils.isNotBlank(pager.getSort())){
			if(pager.getSort().equals("asc"))
				criteria.asc(pager.getOrderBy());
			else
				criteria.desc(pager.getOrderBy());
		}else{
			criteria.desc(PortalBaseParameter.enterpriseId);
		}
		return JdbcDao.queryListByPage(pager, criteria);
	}


	

	private boolean checkIdExist(Long portalBaseParameterId,String id){
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where("id", new Object[]{id});
		if(null!=portalBaseParameterId){
			//criteria.and("portalBaseParameterId",Criteria.FIELD_OPERATOR_NOT,new Object[]{id});
			criteria.and(PortalBaseParameter.portalBaseParameterId,Criteria.FIELD_OPERATOR_NOT,new Object[]{portalBaseParameterId});
		}
		int count = JdbcDao.queryCount(criteria);
		return count>0?true:false;
	}


	@Override
	public void del(Long id) {
		PortalBaseParameter bean=queryBaseParameterById(id);
		//通过模块名称和主键删除lov
		
		portalBaseParameterDao.deleteLovByParameter(bean.getModule_name(), bean.getParam_key());
		JdbcDao.delete(Criteria.create(PortalBaseParameter.class)
				.where(PortalBaseParameter.portalBaseParameterId, new Object[]{id}));
	}

	@Override
	public Long insert(PortalBaseParameter portalBaseParameter) {
			//给id，i18n_paramkey,i18n_desc  set值
		    if(StringUtil.isEmpty(portalBaseParameter.getParam_level())){
		    	portalBaseParameter.setParam_level(CommonConstant.ParameterLevel.GLOBAL);
		    } 
		    if(portalBaseParameter.getModule_name()!=null){
		    	portalBaseParameter.setId(portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key());
		    }else{
		    	portalBaseParameter.setModule_name(portalBaseParameter.getParam_scope());
		    	portalBaseParameter.setId(portalBaseParameter.getParam_scope()+"."+portalBaseParameter.getParam_key());
		    }
			
			portalBaseParameter.setI18n_param_key(portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key());
			portalBaseParameter.setI18n_desc(portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key());
			;
		if(checkIdExist(null,portalBaseParameter.getId())){
			throw new ServiceException("msg.portal.base.parameter.exist");//参数已经存在
		}
		Long resid = JdbcDao.insert(portalBaseParameter);
		//放入redis缓存
		//objectRedisTemplate.opsForValue().set(CommonConstant.REDIS_PARAMETER_KEY+portalBaseParameter.getId(), portalBaseParameter);
		return resid;
	}
	/**
	 * 参数管理修改
	 * {@inheritDoc} 
	 * overridden:
	 * @Date        :      2016-6-27
	 * @see org.eae.eldf.portal.remote.base.PortalBaseParameterService#update(org.eae.eldf.portal.po.base.PortalBaseParameter)
	*
	 */
	@Override
	public void update(PortalBaseParameter portalBaseParameter) {
		 if(StringUtil.isEmpty(portalBaseParameter.getParam_level())){
		    	portalBaseParameter.setParam_level(CommonConstant.ParameterLevel.GLOBAL);
		    }
		  if(portalBaseParameter.getModule_name()==null||"".equals(portalBaseParameter.getModule_name())){
		    	portalBaseParameter.setModule_name(portalBaseParameter.getParam_scope());
		    	portalBaseParameter.setId(portalBaseParameter.getParam_scope()+"."+portalBaseParameter.getParam_key());
		 }else{
			 portalBaseParameter.setId(portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key());
		 }
		  
		if(checkIdExist(portalBaseParameter.getPortal_base_parameter_id(),portalBaseParameter.getId())){
			throw new ServiceException("msg.portal.base.parameter.exist");//参数已经存在
		}
		JdbcDao.update(Criteria.create(PortalBaseParameter.class)
					.set(PortalBaseParameter.enterpriseId, portalBaseParameter.getEnterprise_id())
					.set(PortalBaseParameter.userId, portalBaseParameter.getUser_id())
					.set(PortalBaseParameter.moduleName, portalBaseParameter.getModule_name())
					.set(PortalBaseParameter.paramKey, portalBaseParameter.getParam_key())
					.set(PortalBaseParameter.paramDesc, portalBaseParameter.getParam_desc())
					.set(PortalBaseParameter.i18nParamKey,portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key())
					.set(PortalBaseParameter.i18nDesc, portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key())
					.set(PortalBaseParameter.Id, portalBaseParameter.getModule_name()+"."+portalBaseParameter.getParam_key())
					.set(PortalBaseParameter.paramScope, portalBaseParameter.getParam_scope())
					.set(PortalBaseParameter.paramLevel, portalBaseParameter.getParam_level())
					.set(PortalBaseParameter.dataType, portalBaseParameter.getData_type())
					.set(PortalBaseParameter.paramValue, portalBaseParameter.getParam_value())
					.set(PortalBaseParameter.Valid, portalBaseParameter.getValid())
					.set(PortalBaseParameter.paramGroup, portalBaseParameter.getParam_group())
					.set(PortalBaseParameter.userVisible, portalBaseParameter.getUser_visible())
					.set(PortalBaseParameter.companyVisible, portalBaseParameter.getCompany_visible())
					.where(PortalBaseParameter.portalBaseParameterId, new Object[]{portalBaseParameter.getPortal_base_parameter_id()})
					);
	
		//放入redis缓存
		//objectRedisTemplate.opsForValue().set(CommonConstant.REDIS_PARAMETER_KEY+portalBaseParameter.getId(), portalBaseParameter);
	
	}

	@Override
	public PortalBaseParameter queryBaseParameterById(Long portalBaseParameterId) {
	
		return JdbcDao.get(PortalBaseParameter.class, portalBaseParameterId);
	}

	@Override
	public Pagination<PortalBaseParameter> queryListBaseParameterUser(
			Pagination<PortalBaseParameter> pager, String searchValue) {
		PortalUserSecurityBean u = SpringWebUtils.getRequestUserObj();
		Long loginUserId = u.getPortal_company_user_id();
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where(
				PortalBaseParameter.enterpriseId,new Object[]{SpringWebUtils.getRequestCompany()})
				.and(PortalBaseParameter.userId, new Object[]{loginUserId})
				.and(PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.USER});
		if(StringUtils.isNotBlank(searchValue) && !searchValue.equals("null")){
			criteria.and(PortalBaseParameter.moduleName, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+searchValue+"%"});
		}
		if(StringUtils.isNotBlank(pager.getOrderBy()) && StringUtils.isNotBlank(pager.getSort())){
			if(pager.getSort().equals("asc"))
				criteria.asc(pager.getOrderBy());
			else
				criteria.desc(pager.getOrderBy());
		}else{
			criteria.desc(PortalBaseParameter.companyVisible);
		}
		return JdbcDao.queryListByPage(pager, criteria);
	}

	/**
	 * 企业管理修改
	 * {@inheritDoc} 
	 * overridden:
	 * @Date        :      2016-6-27
	 * @see org.eae.eldf.portal.remote.base.PortalBaseParameterService#updateOnline(org.eae.eldf.portal.po.base.PortalBaseParameter)
	*
	 */
	@Override
	public void updateParameterByUser(PortalBaseParameter portalBaseParameter) {
		String username = SpringWebUtils.getRequestUser();
		String strat = SpringWebUtils.getRequestCompany();
		
		PortalBaseParameter param = parameterService.getParameter(portalBaseParameter.getParam_key(), portalBaseParameter.getModule_name(),strat,username);
		if(null!=param){
			if(!(StringUtils.isNotBlank(param.getEnterprise_id()) &&StringUtils.isNotBlank(param.getUser_id()) && strat.equals(param.getEnterprise_id())&& username.equals(param.getUser_id()))){
				JdbcDao.insert(Criteria.create(PortalBaseParameter.class)
						.set(PortalBaseParameter.enterpriseId, SpringWebUtils.getRequestCompany())
						.set(PortalBaseParameter.userId, username)
						.set(PortalBaseParameter.moduleName, param.getModule_name())
						.set(PortalBaseParameter.paramKey, param.getParam_key())
						.set(PortalBaseParameter.paramDesc, param.getParam_desc())
						.set(PortalBaseParameter.paramScope, param.getParam_scope())
						.set(PortalBaseParameter.paramLevel, CommonConstant.ParameterLevel.USER)
						.set(PortalBaseParameter.dataType, param.getData_type())
						.set(PortalBaseParameter.paramValue, portalBaseParameter.getParam_value())
						.set(PortalBaseParameter.i18nParamKey,param.getModule_name()+"."+param.getParam_key())
						.set(PortalBaseParameter.i18nDesc, param.getModule_name()+"."+param.getParam_key())
						.set(PortalBaseParameter.Id,strat+"."+username+"."+param.getModule_name()+"."+param.getParam_key())
						.set(PortalBaseParameter.Valid, 1)
						.set(PortalBaseParameter.userVisible, 1)
						.set(PortalBaseParameter.companyVisible, param.getCompany_visible())
						.set(PortalBaseParameter.paramGroup, param.getParam_group())
						);
			}else{
				JdbcDao.update(Criteria.create(PortalBaseParameter.class)
						.set(PortalBaseParameter.paramValue, portalBaseParameter.getParam_value())
						.where(PortalBaseParameter.portalBaseParameterId, new Object[]{portalBaseParameter.getPortal_base_parameter_id()})
						.and(PortalBaseParameter.enterpriseId, new Object[]{strat})
						.and(PortalBaseParameter.userId, new Object[]{username})
						.and(PortalBaseParameter.userVisible, new Object[]{1})
						);
			}
		}
	
	}

	@Override
	public Pagination<PortalBaseParameter> queryListBaseParameterEnterprise(
			Pagination<PortalBaseParameter> pager, String searchValue) {
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where(
				PortalBaseParameter.enterpriseId,new Object[]{SpringWebUtils.getRequestCompany()})
				.and(PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.ENTERPRISE});
		if(StringUtils.isNotBlank(searchValue) && !searchValue.equals("null")){
			criteria.and(PortalBaseParameter.moduleName, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+searchValue+"%"});
		}
		if(StringUtils.isNotBlank(pager.getOrderBy()) && StringUtils.isNotBlank(pager.getSort())){
			if(pager.getSort().equals("asc"))
				criteria.asc(pager.getOrderBy());
			else
				criteria.desc(pager.getOrderBy());
		}else{
			criteria.desc(PortalBaseParameter.enterpriseId);
		}
		return JdbcDao.queryListByPage(pager, criteria);
	}

	@Override
	public void updateParameterByEnterprise(PortalBaseParameter portalBaseParameter) {
		String strat = SpringWebUtils.getRequestCompany();
		PortalBaseParameter param = parameterService.getParameter(portalBaseParameter.getParam_key(), portalBaseParameter.getModule_name(),strat,null);
		if(null!=param){
			if(!(StringUtils.isNotBlank(param.getEnterprise_id()) && strat.equals(param.getEnterprise_id()))){
				JdbcDao.insert(Criteria.create(PortalBaseParameter.class)
						.set(PortalBaseParameter.enterpriseId, strat)
						.set(PortalBaseParameter.moduleName, param.getModule_name())
						.set(PortalBaseParameter.paramKey, param.getParam_key())
						.set(PortalBaseParameter.paramDesc, param.getParam_desc())
						.set(PortalBaseParameter.paramScope, param.getParam_scope())
						.set(PortalBaseParameter.paramLevel, CommonConstant.ParameterLevel.ENTERPRISE)
						.set(PortalBaseParameter.dataType, param.getData_type())
						.set(PortalBaseParameter.paramValue, portalBaseParameter.getParam_value())
						.set(PortalBaseParameter.Valid, 1)
						.set(PortalBaseParameter.i18nParamKey,param.getModule_name()+"."+param.getParam_key())
						.set(PortalBaseParameter.i18nDesc, param.getModule_name()+"."+param.getParam_key())
						.set(PortalBaseParameter.Id,strat+"."+param.getId())
						.set(PortalBaseParameter.companyVisible, 1)
						.set(PortalBaseParameter.userVisible, param.getUser_visible())
						.set(PortalBaseParameter.paramGroup, param.getParam_group())
						);
			}else{
				JdbcDao.update(Criteria.create(PortalBaseParameter.class)
						.set(PortalBaseParameter.paramValue, portalBaseParameter.getParam_value())
						.where(PortalBaseParameter.portalBaseParameterId, new Object[]{portalBaseParameter.getPortal_base_parameter_id()})
						.and(PortalBaseParameter.enterpriseId, new Object[]{SpringWebUtils.getRequestCompany()})
						.and(PortalBaseParameter.companyVisible, new Object[]{1})
						);
			}
		}
		
				
	}

	@Override
	public Pagination<PortalBaseParameter> pageMapParameterByEnterprise(Pagination<PortalBaseParameter> pager,String searchValue) {
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where(
				PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.GLOBAL})
				.and(PortalBaseParameter.companyVisible, new Object[]{1});
		if(StringUtils.isNotBlank(searchValue) && !searchValue.equals("null")){
			criteria.and(PortalBaseParameter.moduleName, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+searchValue+"%"});
		}
		if(StringUtils.isNotBlank(pager.getOrderBy()) && StringUtils.isNotBlank(pager.getSort())){
			if(pager.getSort().equals("asc"))
				criteria.asc(pager.getOrderBy());
			else
				criteria.desc(pager.getOrderBy());
		}else{
			criteria.desc(PortalBaseParameter.companyVisible);
		}
		Pagination<PortalBaseParameter> listAllBaseParameters = JdbcDao.queryListByPage(pager, criteria);
		//List<PortalBaseParameter> listAllBaseParameters = queryList(criteria);
		
		Map<String, PortalBaseParameter> mapEnterpiseMap = new HashMap<String, PortalBaseParameter>();
		mapEnterpiseMap = getEnterpriseMap();
		for (int i = 0; i < listAllBaseParameters.getResultList().size(); i++) {
			String id = listAllBaseParameters.getResultList().get(i).getId();
				//判断listAllBaseParameters的id是否存在与map相同的key，存在就替换掉
				if (mapEnterpiseMap.containsKey(id)) {
						//mapEnterpiseMap.put(id, listAllBaseParameters.get(i));
						listAllBaseParameters.getResultList().remove(i);
						listAllBaseParameters.getResultList().add(i,mapEnterpiseMap.get(id));
						
					}
				
			}
		return listAllBaseParameters;
	}

	@Override
	public Pagination<PortalBaseParameter> pageMapParameterByUser(Pagination<PortalBaseParameter> pager,String searchValue) {
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where(
				PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.GLOBAL})
				.and(PortalBaseParameter.userVisible, new Object[]{1});
		if(StringUtils.isNotBlank(searchValue) && !searchValue.equals("null")){
			criteria.and(PortalBaseParameter.moduleName, Criteria.FIELD_OPERATOR_LIKE, new Object[]{"%"+searchValue+"%"});
		}
		if(StringUtils.isNotBlank(pager.getOrderBy()) && StringUtils.isNotBlank(pager.getSort())){
			if(pager.getSort().equals("asc"))
				criteria.asc(pager.getOrderBy());
			else
				criteria.desc(pager.getOrderBy());
		}else{
			criteria.desc(PortalBaseParameter.companyVisible);
		}
		Pagination<PortalBaseParameter> listAllBaseParameters = JdbcDao.queryListByPage(pager, criteria);
		Map<String, PortalBaseParameter> mapUser = new HashMap<String, PortalBaseParameter>();
		//查询出等级为企业 同时企业为当前企业，或者 等级为用户 同时用户为当前用户的参数列表
		mapUser = getMapParameterByUser();
		for (int i = 0; i < listAllBaseParameters.getResultList().size(); i++) {
			String id = listAllBaseParameters.getResultList().get(i).getId();
				//判断map是否存在相同的key，存在的话。替换掉
				if (mapUser.containsKey(id)) {
					listAllBaseParameters.getResultList().remove(i);
					listAllBaseParameters.getResultList().add(i,mapUser.get(id));
					}
				
			}
		return listAllBaseParameters;
	}

	/**
	 * {@inheritDoc} 
	 * overridden:
	 * @Date        :      2016-8-15
	 * @see org.eae.eldf.portal.remote.base.PortalBaseParameterService#queryByParamKey(java.lang.String)
	**/
	@Override
	public PortalBaseParameter queryByParamKey(String paramKey) {
		Criteria criteria = Criteria.create(PortalBaseParameter.class)
				.where(PortalBaseParameter.paramKey, new Object[]{paramKey});
		List<PortalBaseParameter> list=JdbcDao.queryList(criteria);
		if(list.size()>0){
			return list.get(0);
		}
		return null;
	}

	
	
	
	/**
	 * 获取等级为Enterprise且为当前公司的数据，放在map里
	 * @Date        :      2016-7-11
	 * @return
	 */
	public Map<String, PortalBaseParameter> getEnterpriseMap() {
		
		Map<String, PortalBaseParameter> mapEnterpiseMap = new HashMap<String, PortalBaseParameter>();
		Criteria criteria = Criteria.create(PortalBaseParameter.class).where(
				PortalBaseParameter.enterpriseId,new Object[]{SpringWebUtils.getRequestCompany()})
				.and(PortalBaseParameter.paramLevel, new Object[]{CommonConstant.ParameterLevel.ENTERPRISE})
				.and(PortalBaseParameter.enterpriseId, new Object[] { SpringWebUtils.getRequestCompany() });
		//查询等级为enterprise且enterpriseId是自己公司的参数
		List<PortalBaseParameter> listParameters = JdbcDao.queryList(criteria);
			for (int i = 0; i < listParameters.size(); i++) {
				//设置key 的格式，放入map中
				String key = listParameters.get(i).getModule_name()+"."+listParameters.get(i).getParam_key();
				mapEnterpiseMap.put(key, listParameters.get(i));
			}
		return mapEnterpiseMap;
		
	}
	/**
	 * 查询出等级为企业 同时企业为当前企业，或者 等级为用户 同时用户为当前用户的参数列表
	 * @Date        :      2016-7-11
	 * @return
	 */
	public Map<String, PortalBaseParameter> getMapParameterByUser() {
		/*String sql = "select pp.* from portal_base_parameter pp where ((pp.param_level = '"+CommonConstants.ParameterLevel.ENTERPRISE+"' and pp.enterprise_id = '"+SpringWebUtils.getRequestCompany()+"') or (pp.param_level = '"+CommonConstants.ParameterLevel.USER+"' and pp.user_id = '"+SpringWebUtils.getRequestUser()+"'))";
		List<PortalBaseParameter> listBaseParameters = JdbcDao.queryBySQL(sql, PortalBaseParameter.class);*/
		List<PortalBaseParameter> listBaseParameters = portalBaseParameterDao.listPortalBaseParameter(CommonConstant.ParameterLevel.ENTERPRISE, SpringWebUtils.getRequestCompany(), CommonConstant.ParameterLevel.USER, SpringWebUtils.getRequestUser()); 
		Map<String, PortalBaseParameter> mapUser = new HashMap<String, PortalBaseParameter>();
		for (int i = 0; i < listBaseParameters.size(); i++) {
			String key = listBaseParameters.get(i).getModule_name()+"."+listBaseParameters.get(i).getParam_key();
			//判断listBaseParameters的id是否有跟map的key重复的
			if (mapUser.containsKey(key)) {
				//有，则判断是否等级为user,是的话，替换掉
				if (listBaseParameters.get(i).getParam_level().equals(CommonConstant.ParameterLevel.USER)) {
					mapUser.put(key, listBaseParameters.get(i));
				}
			}else {
				//没有listBaseParameters的id是否有跟map的key重复的，直接存放map里
				mapUser.put(key, listBaseParameters.get(i));
			}
			
		}
		return mapUser;
	}

	@Override
	public Long insertList(Map<String, String> map) {
		// TODO Auto-generated method stub
		return portalBaseParameterDao.insertList(map);
	}

	@Override
	public Long insertListMap(List<Map<String, String>> map) {
		// TODO Auto-generated method stub
		return portalBaseParameterDao.insertListMap(map);
	}

	
	  
	
}
